package com.xiaoshuidi.cloud.module.report.dal.mapper.report;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.xiaoshuidi.cloud.framework.mybatis.core.mapper.BaseMapperX;
import com.xiaoshuidi.cloud.module.report.dal.DO.report.ReportContractInfoDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

@Mapper
@InterceptorIgnore(tenantLine = "true")
public interface ReportContractInfoMapper extends BaseMapperX<ReportContractInfoDO> {

    long countHaveIncomeContractsByDate(@Param("startDate")LocalDate startDate, @Param("endDate")LocalDate endDate);

    long countHaveIncomeContractsYesterday(@Param("yesterday")LocalDate yesterday);

    List<ReportContractInfoDO> selectHaveIncomeContractsByDate(@Param("startDate")LocalDate startDate, @Param("endDate")LocalDate endDate);

    List<ReportContractInfoDO> selectHaveIncomeContractsByDateInTurn(@Param("startDate")LocalDate startDate, @Param("endDate")LocalDate endDate, @Param("from")Integer from, @Param("pageSize")Integer pageSize);

    List<ReportContractInfoDO> selectHaveIncomeContractsYesterday(@Param("yesterday")LocalDate yesterday);

    List<ReportContractInfoDO> selectHaveIncomeContractsYesterdayInTurn(@Param("yesterday")LocalDate yesterday, @Param("from")Integer from, @Param("pageSize")Integer pageSize);

    List<ReportContractInfoDO> selectBatchByContractIds(@Param("contractIds")List<Long> contractIds);

}
